/*
 * @Date: 2024-07-08 15:54:32
 * @LastEditors: lyx
 * @LastEditTime: 2024-07-09 08:55:46
 * @FilePath: \minute-dota2\app\[lng]\heros\page.tsx
 * @Description: 
 */

import { getHeroList } from "@/apis/index";
import { useTranslation } from "@/app/i18n/index";
import HeroCard from "@/components/HeroCard/index";
import { IHeroInfo } from "@/typing/hero";
import dayjs from "dayjs";
import Link from "next/link";
import React, { useEffect } from "react";
import { HeroProviders } from "./hero-providers";
import Like from './like';

// export const generateMetadata = async ({ params: { lng } }) => {
//   // eslint-disable-next-line
//   const { t } = await useTranslation(lng, 'posts')
//   return {
//     title: t("title"),
//     description: t("description"),
//     openGraph: {
//       title: '博客列表',
//       description: '这是博客列表页面'
//     }
//   }
// }


export default async function Home() {
  const heros = await getHeroList();
  console.log('heros', heros);
  return (
    <HeroProviders>
      <div className="mx-auto max-w-7xl py-60 lg:py-8 sm:py-32">
        <div className="flex flex-wrap justify-center -m-4">
          {
            heros.map((item: IHeroInfo) => (
              <React.Fragment key={item.id}>
                <HeroCard {...item} />
              </React.Fragment>
            ))
          }
        </div>
      </div>
    </HeroProviders>
  );
}
